#!/usr/bin/python
# -*- coding: UTF-8 -*-
from optparse import OptionParser
from printLog import printLog
import beforeBuildUtils
import creatorAndroidConfig
#import buildFinishUtils
import os
workSpace = ''


def buildHotUpdate():
    printLog("--------开始构建 热更包--------")
    beforeBuildUtils.deleteBuildPath()
    beforeBuildUtils.autoMakeGitBranchs(workSpace)
    creatorAndroidConfig.updateStartSceneUuid()
    creatorAndroidConfig.buildAndroid(workSpace)
    printLog("-------开始校验升级version版本号 拷贝热更资源-------")


if __name__ == "__main__":
    parser = OptionParser()
    parser.add_option('-t', '--buildType', dest="buildType")
    (option, args) = parser.parse_args()
    buildType = option.buildType
    printLog('-------------启动脚本所在目录----------------=' + os.getcwd())
    workSpace = os.path.abspath(os.path.join(os.getcwd(), "../"))
    printLog("--------工程目录--------=" + workSpace)
    os.chdir(workSpace)
    buildHotUpdate()
